package com.cs.controller;

import com.cs.service.CSPubAttachmentsService;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.security.annotation.RequiresLogin;
import com.ruoyi.common.security.annotation.RequiresRoles;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author：bbdf
 * @Package：com.cs.controller
 * @Project：RuoYi-Cloud
 * @name：CSPubAttachmentsController
 * @Date：2024-11-18 19:24
 * @Filename：CSPubAttachmentsController
 */
@Tag(name = "管理后台 - 附件管理")
@RestController
@RequestMapping("/pubAttachments")
public class CSPubAttachmentsController extends BaseController {

    @Autowired
    private CSPubAttachmentsService service;
    @DeleteMapping("/removeFile/{name}")
    @RequiresRoles(value = {"admin"})
    public R<Integer> removeFile(@PathVariable String name){
        return R.ok(service.removeFile(name),"success");
    }
}
